

package com.hazelcast.jet.impl.operation;

import com.hazelcast.jet.impl.execution.init.JetInitDataSerializerHook;
import com.hazelcast.spi.impl.AllowedDuringPassiveState;

import java.util.concurrent.CompletableFuture;

public class IsJobUserCancelledOperation extends AsyncJobOperation implements AllowedDuringPassiveState {

    public IsJobUserCancelledOperation() {
    }

    public IsJobUserCancelledOperation(long jobId) {
        super(jobId);
    }

    @Override
    public CompletableFuture<Boolean> doRun() {
        return getJobCoordinationService().isJobUserCancelled(jobId());
    }

    @Override
    public int getClassId() {
        return JetInitDataSerializerHook.GET_JOB_USER_CANCELLED_OP;
    }
}
